home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d17 / printdoc.arc / PRINTDOC.DOC < prev    next >
Text File  |  1988-04-23  |  16KB  |  322 lines

  1.  
  2.  
  3.  
  4.                                   ------------
  5. ----------------------------------> PRINTDOC <----------------------------------
  6. ----------------------------------> (v. 2.1) <----------------------------------
  7.                                   ------------
  8.  
  9.                                    written by
  10.  
  11.                                 Phillip Garding
  12.                              663 E. Mansfield Ave.
  13.                            Salt Lake City, UT  84105
  14.  
  15.            u-pgardi@sunset.utah.edu.UUCP or utah-cs!utah-ug!u-pgardi
  16.  
  17. ---------------------------->>Statement of purpose<<----------------------------
  18.  
  19.     Printdoc is a utility for printing text files on both sides of
  20. sheets of paper.  Gone will be the days of using 64 sheets of paper to
  21. print a 64 page manual; now it will consume only 32 sheets.  The
  22. mechanism used is to print all of the odd numbered pages on the printer,
  23. and save the even-numbered pages to a file, pause, allowing the operator 
  24. to remove the paper, turn it over, and then print the even-numbered pages 
  25. on the back sides.  In addition, Printdoc also has the ability to insert 
  26. page breaks (headers and footers) into a long text file that would otherwise 
  27. print out as a continuous sheet of text. The operation of Printdoc can be 
  28. modified to accomodate any length sheets of paper, although the default 
  29. value is the standard 8 1/2 x 11 size.
  30.       For best results, use an older ribbon, since new ribbons usually
  31. print an image dark enough to show through to the other side of the paper
  32. and to obscure text that may be printed there.  If it is important to have 
  33. a dark copy, use a heavy stock paper that won't let the print show through.
  34.     It is essential to preview the file on the screen before printing, 
  35. so that the parameters may be correctly set, and anomalies such as title
  36. pages, etc. can be planned for.  To know more, keep reading . . .
  37.  
  38.  
  39. ------------------------>>Requirements and assumptions<<------------------------
  40.  
  41. Printdoc requires that:     
  42.     - there is space in the current directory equivalent to at least
  43.         one-half of the size of the text file to be printed
  44.      - the source file must be ascii
  45.     - all lines of text are terminated by a "new-line character" (CR)
  46.         (i.e. the end-of-file marker must not be on the same
  47.                line as text)
  48.     - no file by the name of "---hi---.you" can exist in the current
  49.         directory (why would you have a file with a name like
  50.         this anyway?), since the even-numbered pages are stored in
  51.         a created file of this name.
  52.  
  53.  
  54. --------------------------------->>Invocation<<---------------------------------
  55.  
  56.     Printdoc can be invoked with the name "printdoc", and the file
  57. to be printed can be given as a command line parameter.     
  58.     For example: "printdoc manual.txt". 
  59. If the file is not specified on the command line, printdoc will prompt
  60. for the name of the file.  The filename string cannot be longer than 64
  61. characters, and can include a path, as well as the file name.  
  62.     For example: "printdoc c:\swamp\land\sales\howto.doc".  
  63.  
  64.  
  65. ---------------------------------->>Options<<-----------------------------------
  66.  
  67.     When Printdoc is run, after the filename has been recognized,
  68. and the file found and opened, you will be asked if you would like to
  69. view and/or change the parameter settings.  A response of 0 will accept 
  70. the default settings, but by responding 1 to this query, a menu showing 
  71. the four settings and their default values will be shown.  Choosing the 
  72. number to the left of a parameter will allow you to read a description 
  73. of that parameter's function and allow you to change its value.  The 
  74. various parameters are discussed below.
  75.  
  76.    *-**-***-*****-********-*************-*********************-**************...
  77.     Parameter:          page size
  78.     Default setting:        66 
  79.  
  80.     Description:        The page size is the number of lines that
  81.                 can be printed on one page.  For a standard
  82.                 8 1/2 x 11 inch sheet, this is 66 (the 
  83.                 default).  For a legal sized sheet of paper,
  84.                 8 1/2 x 14 inches, the value is 84.  To
  85.                 calculate the number of lines for an 
  86.                 arbitrary size sheet, multiply the length in
  87.                 inches by 6.
  88.  
  89.     Setting Options:        new value, or enter 0 for default (66).
  90.    *-**-***-*****-********-*************-*********************-**************...
  91.     Parameter:        line width.
  92.     Default setting:        80
  93.  
  94.     Description:        The line width is the maximum number of char-
  95.                 acters that will be read by printdoc for one
  96.                 line.  If the document has lines greater than
  97.                 80 characters, this parameter must be set to 
  98.                 the GREATEST EXPECTED value.  Note: this value
  99.                 does not include the CR at the end of the line.
  100.  
  101.     Setting Options:        new value, or enter 0 for default (80).
  102.    *-**-***-*****-********-*************-*********************-**************...
  103.     Parameter:        text mode
  104.     Default setting:        pica
  105.  
  106.     Description:        The text can be printed on the printer in a 
  107.                 variety of pitches.  The codes used are 
  108.                 standard Epson/IBM printer codes.  Pitches/
  109.                 modes available are pica, elite, condensed,
  110.                 near-letter quality (on my STAR, this is
  111.                 always 10 char/inch, but may vary on other
  112.                 printers), and custom.  For the case of custom 
  113.                 text mode, the user enters the decimal values 
  114.                 of the printer codes he/she wishes to send to 
  115.                 the printer.  CHOOSING ELITE AND CONDENSED WILL
  116.                 CHANGE THE SIZE OF THE LEFT MARGIN.  It is
  117.                 assumed that a margin is desired (for hole-
  118.                 punching, etc.); elite and condensed set the
  119.                 left margin for 1 inch.  If this is not desired,
  120.                 it is necessary to reset the left margin 
  121.                 parameter after selecting the text mode.
  122.  
  123.     Setting Options:        1.  pica (10 char/inch)        ESC - P
  124.                 2.  elite (12 char/inch)    ESC - M
  125.                 3.  condensed (17 char/inch)    ESC - <SI>
  126.                 4.  near-letter quality on    ESC - x - 1 
  127.                             (off    ESC - x - 0)
  128.                 5.  custom
  129.    *-**-***-*****-********-*************-*********************-**************...
  130.     Parameter:        printer device.
  131.     Default setting:        prn.
  132.  
  133.     Description:        This is the dos device name to which your 
  134.                 printer is assigned.
  135.  
  136.     Setting Options:        1.  prn
  137.                 2.  lpt1
  138.                 3.  lpt2
  139.    *-**-***-*****-********-*************-*********************-**************...
  140.     Parameter:        Left margin.
  141.     Default setting:        0
  142.  
  143.     Description:        This is the size of the left margin INSERTED
  144.                 by printdoc.  This value does not include any
  145.                 margin that may be built into the document to
  146.                 print.  Note: selecting a text mode of elite
  147.                 or condensed will cause this value to be set
  148.                 to a one-inch margin (12 for elite, 17 for
  149.                 condensed.  If this is not the size margin
  150.                 desired for one of those pitches, it is 
  151.                 necessary to choose the text mode, then reset
  152.                 the left margin value.
  153.  
  154.     Setting Options:        New value, or 0 for current value.
  155.    *-**-***-*****-********-*************-*********************-**************...
  156.     Parameter:          Page breaks
  157.     Default setting:        yes
  158.     
  159.     Description:        A page break is a set of blank lines used to
  160.                 separate one page from another, and to put a
  161.                 margin at the top and bottom of a page of
  162.                 print.  The page break parameter tells 
  163.                 Printdoc whether the source file has blank 
  164.                 lines in it already, or whether Printdoc must
  165.                 put in headers and footers for each page.
  166.                 In the default case, Printdoc IS EXPECTING
  167.                 page breaks to already exist.  If the default
  168.                 setting is changed to no, then Printdoc will
  169.                 print blank lines at the top of each page,
  170.                 count and print the number of lines of text 
  171.                 for one page (page size - (header + footer),
  172.                 then fill in blank lines to complete the page.
  173.  
  174.     Setting options:        Enter 1 for yes or enter 0 for no.
  175.    *-**-***-*****-********-*************-*********************-**************...
  176.     Parameter:        Header size.
  177.     Default setting:        3.
  178.     
  179.     Description:        The header is the number of blank lines printed
  180.                 at the top of a page.  The default setting is
  181.                 3 lines, which equals 1/2 inch. This parameter 
  182.                 is used only if page breaks is no.
  183.  
  184.     Setting options:        Enter new value or enter 0 for default (3).
  185.    *-**-***-*****-********-*************-*********************-**************...
  186.     Parameter:        Footer size.
  187.     Default setting:        8.
  188.     
  189.     Description:        The footer is the number of blank lines printed
  190.                 at the bottom of a page.  The default setting 
  191.                 is 8 lines, which equals 1 1/3 inch. This 
  192.                 parameter is used only if page breaks is no.
  193.  
  194.     Setting options:        Enter new value or enter 0 for default (8).
  195.    *-**-***-*****-********-*************-*********************-**************...
  196.     Parameter:        Page numbers.
  197.     Default setting:        yes.
  198.  
  199.     Description:        If page breaks are to be inserted, printdoc
  200.                 can also print page numbers at the bottom of
  201.                 each page.
  202.  
  203.     Setting Options:        Enter 1 for yes, enter 0 for no.
  204.    *-**-***-*****-********-*************-*********************-**************...
  205.  
  206.  
  207. ---------------------------->>Reversing the paper<<-----------------------------
  208.  
  209.     After Printdoc has printed all of the odd numbered pages and stored
  210. the even-numbered pages into the file "---hi---.you", it will pause, asking
  211. that you remove the paper from the printer, turn it over and realign it with
  212. the top of the first page under the print head.  When the printer is ready,
  213. hit the return key.
  214.     This sounds incredibly easy, but it is amazing difficult to do
  215. correctly.  In testing and debugging Printdoc, I have probably uncovered
  216. all of the ways to do this operation wrong.  Watch out for the following
  217. mistakes:
  218.  
  219.     - Refeed the paper with the already printed side up, so that
  220.         page 2 prints over page 1, etc.  The result is that you can 
  221.         print four pages on one sheet of paper, two on each side.  
  222.         Unfortunately, you can't read any of it.
  223.     - Start printing the even-numbered pages on the back of the
  224.         wrong odd-numbered page (page 4 goes on the back of page 1,
  225.         page 6 on the back of page 3, etc.)
  226.     - If the manual has a title page, it does not properly count as a
  227.         "numbered page", so instead of the odd numbered pages being
  228.         printed, the even-numbered pages are printed in the first
  229.         run.  If you don't want page one to begin on the back of the
  230.         title page, then start printing on the back of the SECOND
  231.         sheet (page 2).
  232.     - If the manual has a title page, it may also have a second 
  233.         "unnumbered page", (such as a statement of copyright, intro-
  234.         duction, etc) in which case you will have to print this page 
  235.         on the back of the title page.  This situation is unexpected
  236.         because the second "unnumbered page" isn't visible; it is in 
  237.         the pages stored on the disk.  The only cure for this is to 
  238.         inspect the document before you run Printdoc, so that you 
  239.         know what is coming.
  240.     - If the manual has a title page, and you wish to start the document
  241.         on a new sheet of paper, and if the length of the document is
  242.         odd, then it will be necessary to leave an extra blank sheet
  243.         at the end of the first run, since the first run is printing
  244.         the even pages, and there is one more odd page than even pages.
  245.     - Don't forget to leave a page for the tractor feed to pull all of the
  246.         pages through the printer.  If your printer uses a pulling 
  247.         tractor feed (sprockets pull paper after it has passed under 
  248.         the print head), leave a page in front, and if your printer 
  249.         uses a push tractor, leave an extra sheet after the last page.
  250.  
  251.  
  252. --------------------->>Miscellaneous thoughts and warnings<<--------------------
  253.  
  254.     Keep the following in mind when using Printdoc:
  255.  
  256.     - It will always be worth the effort to examine at least the first few
  257.         pages of the document on the screen before printing.  This way
  258.         you can see if the file has page breaks, or if there is a 
  259.         title and other pages that deserve special treatment.
  260.     - In previewing the document, watch for "form feed" characters.  These
  261.         will appear on the left column as a graphics character (often
  262.         resembling the "male" symbol, a circle with an arrow coming
  263.         out of the bottom.  Form feeds are handled by printdoc, and not
  264.         by the printer.  In my experience, a document with form feeds 
  265.         is organized using the form feed character for a page break.
  266.         A page break may be there without having explicit blank lines.
  267.     - If the document doesn't have page breaks, and Printdoc is inserting
  268.         blank lines, it may make the page layouts look strange.  As
  269.         an example, it may put a section head at the bottom of one page
  270.         but print the text of the section on the next page, or a table 
  271.         may be artificially split onto two pages, etc.  Remember, all 
  272.         that Printdoc is doing is counting lines; it has no idea what 
  273.         those lines contain.
  274.     - If the layout of the document is important, it may be worthwhile to
  275.         edit the file first, and place your own headers and footers, 
  276.         so that continuity is maintained.
  277.     - Before printing the other sides of the pages, look at how the
  278.         odd-numbered pages printed.  One software manual that I had
  279.         printed had one page too short, so everything after that 
  280.         page was half on the one sheet of paper, and half on another.
  281.         This will save the time, frustration and printer ribbon 
  282.         expense of printing the even-numbered pages when the odd-
  283.         numbered pages have an error.
  284.     - Remember to save old printer ribbons, since a new ribbon will 
  285.         usually go through a light stock paper, which printer paper
  286.         tends to be.  For best results, use an older ribbon, or buy
  287.         heavy paper that won't let the print show through.
  288.     - Most documents are 80 columns wide, and in standard print modes
  289.         (pica), 80 columns leaves little room for side margins.  If
  290.         a margin is important (for punching holes to put the document
  291.         into a binder, for instance), try setting your printer into
  292.         a narrower print font (elite or condensed) or center the line 
  293.         of text as best as possible on the page.  A narrow left margin
  294.         on the "odd pages" will also print with a narrow left margin
  295.         on the "even side", except that the left margins on the two
  296.         sides of the page are not in the same place.  (Are you 
  297.         confused?  Just try it; you'll see.)
  298.     
  299.  
  300. ---------------------------------->>Begging<<-----------------------------------
  301.  
  302.     I wrote printdoc for my own use, and I want to share it with others.  
  303. I have no serious intention to make my fortune from selling this program, 
  304. but I am a computer science student on a budget, and I certainly wouldn't
  305. refuse if a payment was sent to me for writing this program.  So if you have 
  306. some extra change in your pocket, why not pop it in an envelope, and mail it 
  307. to me.  You'll never miss it, and it may allow me to buy one of four $50 
  308. textbooks that I use each quarter.  Please don't send any more than $50,000, 
  309. however, as I would have to declare it on my income tax.
  310.     If you are a student, and you use this program, I expect no payment.  
  311. If you are gainfully employed, however, I am asking $4.00.
  312.  
  313.     Any paying users of this program will be put on a mailing list, and
  314. revisions of the program will be sent to them.  (Planned additions include
  315. adding a comment (such as the name of the file) in the header of each page,
  316. and allowing multiple files to be specified on the command line, which will
  317. be printed in the order they are listed.)
  318.  
  319.  
  320.     Thanks, and I hope that you enjoy Printdoc.
  321.  
  322.